package com.wiloon.java8x.protocol;

import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Created by Roy on 2015/8/18.
 */
public class protocolExcelReader {
    public static void main(String[] args) {
        String protocolExcelUrl = "D:\\projects\\";
        try {
            InputStream inputStream = new FileInputStream(protocolExcelUrl);
            XSSFWorkbook workbook = new XSSFWorkbook(inputStream);
            int[] sheetIndexArray = {32, 34, 35, 36, 37};
            for (int sheetIndex : sheetIndexArray) {
                XSSFSheet sheet = workbook.getSheet("xxx");
                XSSFRow row = sheet.getRow(2);
                XSSFCell cell = row.getCell(2);
                String value = cell.getStringCellValue();
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
